<?php
/**
 * 物流配置
 *
 * 物流配置controller
 *
 * @author    zhouchao <zhouchao@yunys.com.cn>
 * @copyright 2016 QuanZhouYunYiShang Inc.
 */
namespace App\Http\Controllers\Backstage;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Services\ExpressService\ExpressService;

class ExpressController extends Controller
{
    public function __construct(ExpressService $express_service)
    {
        $this->express_ser = $express_service;
    }

    /**
     * 获取物流列表
     * @return $this
     */
    public function getList()
    {
        $express = $this->express_ser->expressList(array('per_page'=>50));
        return view('backstage/express/list')
            ->with('express',$express);
    }

    /**
     * 添加物流
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function postAdd(Request $request)
    {
        $input	= $request->all();
        $result	= $this->express_ser->addExpress($input);
        return response()->json($result);
    }

    /**
     * 删除物流
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function postDelete(Request $request){
        $input	= $request->all();
        $result	= $this->express_ser->delExpress($input);
        return response()->json($result);
    }


}
